package com.example.demo.controller;

import com.example.demo.Service.ExecRegistService;
import com.example.demo.beans.ExecRegistRequest;
import com.example.demo.beans.ExecRegistResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 执行挂号或者预约挂号
 */
@RestController
public class ExecRegistController {

@Autowired
@Qualifier("ExecRegistService")
private ExecRegistService service;
    @ResponseBody
    @RequestMapping(value = "ExecRegist",produces = {"application/xml"})
    public ExecRegistResponse ExecRegist
            (@RequestBody ExecRegistRequest request){
     if(request!=null){
       return service.ExecRegistPatient(request);
     }
        ExecRegistResponse response=new ExecRegistResponse();
     response.setResultCode("0");
     response.setResultMsg("请求参数为空，请检查！");
       return  response;
    }
}
